package cn.mapper;

import cn.entity.User;
import com.ymx.darling.mapper.EntityMapper;
import com.ymx.darling.mapper.annotation.MapKey;
import com.ymx.darling.mapper.annotation.Select;
import com.ymx.darling.mapper.annotation.Update;

import java.util.Map;

public interface UserMapper extends EntityMapper<User>{
    @MapKey("id")
    @Select("select * from user where age = #{age}")
    Map<String, User> findByAge(int age);

    @Update("delete from user where id = #{id}")
    int deleteById(int id);
}
